|
|
|
|
|
|
|
To create your class, use the Class Builder utility found in the Visual Basic Add-Ins menu. The first step is to start a Standard EXE project. Don't do anything with the form that is automatically added to the project; you will use it later. The new class, called GetAge, that you will build will have the properties, methods, and events listed in Table 5.2. |
|
|
|
|
| TABLE 5.2. NEW CLASS DEFINITIONS. | | Group | Name | Data Type | Description | | Property | Birthdate | String | Input date used to calculate the age of a person | | AgeLimit | Integer | Used to set the age limit for the event calculation | | Age | Integer | Read-only value containing the calculated age | | Method | CalcAge | | Class procedure that calculates the age | | Event | Underage | | This event will be triggered if the calculated age is under the AgeLimit value | | OverAge | | This event will be triggered if the calculated age is over the AgeLimit value |
|
|
|
|
|
|
To begin the process, start the Class Builder utility to display the Class Builder interface (see Figure 5.3). |
|
|
|
|
|
|
|
|
Figure 5.3.
The Class Builder utility helps you define a new class using an Explorer-style application interface. |
|
|
|
|
|